Skip to content

ext/standard/tests: 32bit wordwrap tests aren't just for Windows #14814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from

Conversation

orlitzky
Copy link
Contributor

@orlitzky orlitzky commented Jul 4, 2024

The test in strings/wordwrap_memory_limit.phpt has a counterpart in strings/wordwrap_memory_limit_win32.phpt. The two are conditional on both the OS name and the size of an int (32- versus 64-bits).

A Gentoo Linux user has however reported that the 64-bit test fails on a 32-bit system, with precisely the error message that the "win32" test is expecting. I don't have any 32-bit hardware to test myself, but I think it's reasonable to conclude that the OS name is not an essential part of the test: it's simply 32- versus 64-bit.

This commit drops the conditionals for the OS name. Now one test will be run on 32-bit systems, and the other on 64-bit systems, regardless of the OS name.

Bug: https://bugs.gentoo.org/935382

The test in strings/wordwrap_memory_limit.phpt has a counterpart in
strings/wordwrap_memory_limit_win32.phpt. The two are conditional on
both the OS name and the size of an int (32- versus 64-bits).

A Gentoo Linux user has however reported that the 64-bit test fails on
a 32-bit system, with precisely the error message that the "win32"
test is expecting. I don't have any 32-bit hardware to test myself,
but I think it's reasonable to conclude that the OS name is not an
essential part of the test: it's simply 32- versus 64-bit.

This commit drops the conditionals for the OS name. Now one test will
be run on 32-bit systems, and the other on 64-bit systems, regardless
of the OS name.

Bug: https://bugs.gentoo.org/935382
@orlitzky
Copy link
Contributor Author

orlitzky commented Jul 4, 2024

I suppose the only risk here is that there are still 32-bit linux systems that raise the first kind of error (and not the "win32" error). If that turns out to be the case we could combine the two like in #14788 so that either error message will PASS on any machine.

@orlitzky
Copy link
Contributor Author

orlitzky commented Jul 4, 2024

I suppose the only risk here

Looks to be the case on debug/zts builds. I'll combine the two.

…outputs

It turns out that on a 32-bit system, this test can produce either the
"usual" expected output from the 64-bit test, OR the 32-bit-only
integer overflow message. We copy the dual expected outputs from
chunk_split_variation1_32bit.phpt to handle both cases.

This fixes an earlier commit that split the two tests based only on
the size of an int (32-bit versus 64-bit). The CI reveals that, at
least on a debug/zts build, the "64-bit" memory limit error (and not
the integer overflow error) is still produced.
Copy link
Member

@nielsdos nielsdos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe you are right indeed, thanks for catching this!

nielsdos added a commit that referenced this pull request Jul 4, 2024
* PHP-8.2:
  NEWS for GH-14814
  ext/standard/tests: strings/wordwrap_memory_limit_32bit.phpt has two outputs
  ext/standard/tests: 32bit wordwrap tests aren't just for Windows
@nielsdos nielsdos closed this in 1006e10 Jul 4, 2024
nielsdos added a commit that referenced this pull request Jul 4, 2024
* PHP-8.3:
  NEWS for GH-14814
  ext/standard/tests: strings/wordwrap_memory_limit_32bit.phpt has two outputs
  ext/standard/tests: 32bit wordwrap tests aren't just for Windows
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants